public class Demo04 {

    public static void main(String[] args) {

        //定义一个 长度为10的数组
        int[] arr1 = new int[10];

        //统计数组赋值的个数
        int cnt  = 0;
        //给数组赋值
        for (int i = 0; i < arr1.length; i++) {
            arr1[i] = 1;
            cnt++;
            //判断数组容量是否达到80%
            if (cnt>=arr1.length*0.8){
                break;
            }
        }
        //给数组进行扩容,创建一个新数组，长度为arr1的1.5倍,结果向下取整
        int[] arr2 = new int[arr1.length*3/2];
        //将arr1数组内容复制到arr2上
        System.arraycopy(arr1,0,arr2,0,arr1.length-1);

        //打印数组arr1
        for (int i = 0; i < arr1.length; i++) {
            System.out.print(arr1[i]);
        }
        //换行
       System.out.println();
        //打印数组arr2
        for (int i = 0; i < arr2.length; i++) {
            System.out.print(arr2[i]);
        }

    }

}

